const {log} = console
// 运行时才出现的问题
const obj = {}
// obj.foo() // TypeError: obj.foo is not a function

//===============================

function sum(a,b) {
  return a + b
}
log(sum(100,100)) // => 200
log(sum(100,'100')) // => 100100

//===============================

obj[true] = 100
log(obj['true']) // => 100

// ================================

// flow
// 本项目安装 npm install flow-bin --only=dev
// 关闭VSCode的JavaScript校验：vscode->设置-> javascript validate ->去除打勾
// @flow
function sum1(a: number,b: number) {
  return a + b
}
log(sum1(100,100)) // => 200
log(sum1(100,'100')) // => 100100